logError() prints an exception with an optional prefix, and is
used fairly commonly through-out the code base.
The problem is that by being defined in gjs, it uses "Gjs" as the
GLib log domain, not our own as expected.
Address this by adding a small override that implements the function
with console.error().
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3072>
/** @returns {void} */
export async function start() {
globalThis.log = console.log;
+ globalThis.logError = function (err, msg) {
+ const args = [err];
+ try {
+ // toString() can throw
+ if (msg)
+ args.unshift(`${msg}:`);
+ } catch (e) {}
+
+ console.error(...args);
+ };
// Chain up async errors reported from C
global.connect('notify-error', (global, msg, detail) => {